-> root -> software -> ::software::lvm
All the notes regarding linux lvm system.
Notes on this page:

Very slow boot, near "Setting up LVM Volume Groups..."
[35]

The whole message looks something like:
     Setting up LVM Volume Groups...
     Reading all physical volumes. This may take a while...
   
followed by lot of kernel messages.

Well, that's the problem: lvscan, to find all the phyisical volumes, will just scan the first few sectors of every device on the system.

If you happen to have something particularly slow, lot of devices, or ... you are an aficionado of devfs (which will probe modules as pvscan tries to find those volumes), you will want to change /etc/lvm.conf.

Just add something like:
     filter = [ "a|/dev/md*|", "a|/dev/sd*|" ]
   
in that file, to tell pvscan to search only in /dev/md* and /dev/sd*

After removing a partition, all lvm tools keep failing
[36]

LVM tools keep a cache of all the partitions known, in /etc/lvm/.cache. If you just changed the layout of the paratition table, and you try to use lvm tools, you should first run:
 pvscan
 
that will refresh the cache. Errors likely caused by the cache are:
 Failed to read existing physical volume
 /dev/XXXX does not exist
 ...
 
This note is available in the following categories:

Creating a logical volume using all the space of a volume group
[47]

Just:

  • check how many extents you have available in the volume group

  • use lvcreate with the -l option to specify the number of extents

For example:
   % vgs -o vg_name,vg_size,vg_free,vg_extent_count,vg_free_count
   VG     VSize  VFree #Ext  Free
   system 67.96G 8.96G 17397 2293
   % lvcreate -n backup -l 2293 system
   
will create a logical volume 'backup', from the volume group 'system', using up all the space available (2293 extents).

Instead of using vgs, you can use vgdisplay, and use the field:
     [...]
     Free  PE / Size       2293 / 8.96 GB
     [...]
   

This note is available in the following categories:

Creating a logical volume using all the space of a volume group
[48]

Just:

  • check how many extents you have available in the volume group

  • use lvcreate with the -l option to specify the number of extents

For example:
   % vgs -o vg_name,vg_size,vg_free,vg_extent_count,vg_free_count
   VG     VSize  VFree #Ext  Free
   system 67.96G 8.96G 17397 2293
   % lvcreate -n backup -l 2293 system
   
will create a logical volume 'backup', from the volume group 'system', using up all the space available (2293 extents).

Instead of using vgs, you can use vgdisplay, and use the field:
     [...]
     Free  PE / Size       2293 / 8.96 GB
     [...]
   

This note is available in the following categories:
Generated by CRON on 2012/02/14 at 06:26:35.